package com.wangwei.modules.controller

import com.wangwei.modules.service.MyService
import com.wangwei.modules.servlet.spring.Autowired
import com.wangwei.modules.servlet.spring.RequestMapping
import com.wangwei.modules.servlet.spring.RestController
/**
 *测试同名方法和注入
*/
@RestController
class HelloWordController {

	@Autowired
	lateinit var myService: MyService

	@RequestMapping("hello")
	fun hello(name: String?) = myService.hello(name)


	@RequestMapping("/hello/times")
	fun hello(name: String?, times: Integer?): String {

		return "$times 、hello $name !";
	}

	
	@RequestMapping("s")
	fun sys(): Any {

	//	var com = ComponentFactory.getBeanByClass(HelloWordController::class.java);

	//	var m = ServletFactory.getSpringMethodByPath("/hello");

		return "{}"
	}

}